package com.slofzx.nuoda.evaluation.project.controller;

import com.slofzx.nuoda.common.vo.AjaxResultVO;
import com.slofzx.nuoda.evaluation.project.dto.AnalysisQueryDTO;
import com.slofzx.nuoda.evaluation.project.service.AnalysisService;
import com.slofzx.nuoda.evaluation.project.vo.AnalysisDataVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/project/analysis")
public class AnalysisController {
    @Autowired
    private AnalysisService analysisService;

    /**
     * 查询大区数据
     * @param dto
     * @return
     */
    @RequestMapping("/region")
    public AjaxResultVO<List<AnalysisDataVO>> queryRegion(AnalysisQueryDTO dto) {
        List<AnalysisDataVO> dataVOList = analysisService.queryRegion(dto);
        return AjaxResultVO.newSuccessResult(dataVOList);
    }
    /**
     * 查询油气藏数据
     * @param dto
     * @return
     */
    @RequestMapping("/pool")
    public AjaxResultVO<List<AnalysisDataVO>> queryPool(AnalysisQueryDTO dto) {
        List<AnalysisDataVO> dataVOList = analysisService.queryPool(dto);
        return AjaxResultVO.newSuccessResult(dataVOList);
    }

    /**
     * 查询油气藏数据
     * @param dto
     * @return
     */
    @RequestMapping("/office")
    public AjaxResultVO<List<AnalysisDataVO>> queryOffice(AnalysisQueryDTO dto) {
        List<AnalysisDataVO> dataVOList = analysisService.queryOffice(dto);
        return AjaxResultVO.newSuccessResult(dataVOList);
    }

    /**
     * 查询新老区数据
     * @param dto
     * @return
     */
    @RequestMapping("/area")
    public AjaxResultVO<List<AnalysisDataVO>> queryArea(AnalysisQueryDTO dto) {
        List<AnalysisDataVO> dataVOList = analysisService.queryArea(dto);
        return AjaxResultVO.newSuccessResult(dataVOList);
    }
    /**
     * 查询新老区数据
     * @param dto
     * @return
     */
    @RequestMapping("/capacity")
    public AjaxResultVO<List<AnalysisDataVO>> queryCapacity(AnalysisQueryDTO dto) {
        List<AnalysisDataVO> dataVOList = analysisService.queryCapacity(dto);
        return AjaxResultVO.newSuccessResult(dataVOList);
    }

    /**
     * 查询趋势分析
     * @param dto
     * @return
     */
    @RequestMapping("/tend")
    public AjaxResultVO<List<AnalysisDataVO>> queryTend(AnalysisQueryDTO dto) {
        List<AnalysisDataVO> dataVOList = analysisService.queryTend(dto);
        return AjaxResultVO.newSuccessResult(dataVOList);
    }
}
